package cn.spark.study.core

import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

object OtherFunction {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf()
        .setAppName("WordCount")
        .setMaster("local")
        
    
    val sc = new SparkContext(conf)
    val lines = sc.textFile("C://Users//e20160504//Desktop//spark1.txt", 1)
    
//    val pairs = lines.map { line => (line,line.length()) }
//    val lines1 = lines.filter { line => line.contains("you") }
      lines.flatMap { line => line.split(" ") }
//    lines1.foreach { line => println(line) }
  }
}